﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace App.Store
{
    public partial class frmStateSelect : Form
    {
        Entities db = new Entities();

        T_Sample m_Sample = null;

        public int m_xID
        {
            set
            {
                var list = db.T_Sample.Where(a => a.xID == value).ToList();
                foreach (T_Sample sample in list)
                {
                    m_Sample = sample;
                    break;
                }

                if (m_Sample == null) return;

                bs1.DataSource = m_Sample;

                var selectlist = from a in db.T_Sample
                                 from b in db.T_Flow
                                 where a.xID == b.xID && a.xID == m_Sample.xID
                                 select new { a.productNo, b.reason, b.sCount, b.opDate, b.opName, b.commandName };

                bs2.DataSource = selectlist.ToList();
            }
        }

        public frmStateSelect()
        {
            InitializeComponent();
        }

        private void btn3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}
